
$(document).ready(function() {
    
	var nick = Utils.getUrlParam("nick");
	
	if($.trim(nick) != "") {
		$(".input-txt").val(nick);
		queryNick();
	}
	
	$(".input-bt").click(function() {
        queryNick();
    });
	
	//点回车搜索
	$(".input-txt").keydown(function(e) {
        if(e.keyCode == "13") {
        	queryNick();
		}
    });
	
	function queryNick() {
		var nick = $(".input-txt").val();
		if($.trim(nick) == "") {
			return;
		}
		
		var param = {
			oriStr: nick,
			toCode: "GBK",
		};
		AQ.callAQ("convertChartCode.do", param, function(result) {
			var Link = "http://tradecardseller.wangwang.taobao.com/tradecard/nameCard.htm?uid=cntaobao";
			$("iframe").prop("src", Link + result[0].info);
		}, function(err, code) {
			Utils.msgDialog(err + "["+ code +"]");
		});
	}
	
});